/* Programatically Register the glue */
jmaki.addGlueListener({topic : "/dojo/fisheye",action: "call", target: { object: "jmaki.dynamicfaces",functionName: "fishEyeValueUpdate"}});

/*
* Define an object to hang the glue listeners off of
*/
jmaki.dynamicfaces = {
    fishEyeValueUpdate : function(args) {
        // args come in as {target: dojoIcon, wargs: widgetArguments}
        var _w = args.wargs;
        var _item = args.target;
        // If dojo removed the div declared in component.htm
        // from the DOM.
        var hidden = null;
        if (_w.form) {
            // create an inputHidden with the proper value.
            hidden = document.createElement("input");
            hidden.type = "hidden";
            hidden.id = _w.uuid;
            hidden.value = _item.index;
            _w.form.appendChild(hidden);
        }
        DynaFaces.fireAjaxTransaction(hidden, 
            { 
                render: _w.uuid,
                inputs: _w.uuid		    
            });
    }
}